<template>
	<view class="mainbgc">
		<view class="content">
			<view class="center flexbetween">
				<view class="text_weight">公司名称</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入公司名称" v-model="kaipiao.gsmc"></input>
				</view>
			</view>
			<view class="center_a flexbetween">
				<view class="text_weight">税号</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入税号" v-model="kaipiao.sh"></input>
				</view>
			</view>
			<view class="center_a flexbetween">
				<view class="text_weight">账号</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入账号" v-model="kaipiao.zh"></input>
				</view>
			</view>
			<view class="center_a flexbetween">
				<view class="text_weight">开户行</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入开户行" v-model="kaipiao.khh"></input>
				</view>
			</view>
			<view class="center_a flexbetween">
				<view class="text_weight">地址</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入地址" v-model="kaipiao.address"></input>
				</view>
			</view>
			<view class="center_a flexbetween">
				<view class="text_weight">电话</view>
				<view class="flexleft">
					<input class=" leixing" placeholder="请输入电话号码" v-model="kaipiao.mobile"></input>
				</view>
			</view>
		</view>
		<view class="query" @click="submit()">确认</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				kaipiao: {
					gsmc: "蓝海集团",
					sh: "95932847322234",
					zh: "182828361",
					khh: "中国银行",
					address: "莲花街碧荷路交叉口",
					mobile: "18877778988"
				}
			}
		},
		methods: {
			submit() {
				if (this.kaipiao.gsmc == "") {
					httpRequest.toast("请填写公司名称");
					return false
				}
				if (this.kaipiao.sh == "") {
					httpRequest.toast("请填写税号");
					return false
				}
				if (this.kaipiao.zh == "") {
					httpRequest.toast("请填写账号");
					return false
				}
				if (this.kaipiao.khh == "") {
					httpRequest.toast("请填写开户行");
					return false
				}
				if (this.kaipiao.address == "") {
					httpRequest.toast("请填写详细地址");
					return false
				}
				if (this.kaipiao.mobile == "") {
					httpRequest.toast("请填写电话");
					return false
				}
				if (!this.kaipiao.mobile.match(/^1\d{10}$/)) {
					httpRequest.toast("请输入有效的手机号码");
					return false;
				}
				uni.$emit("kaipiaoevent",this.kaipiao)
				uni.navigateBack(1)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.mainbgc {
		padding: 30rpx 30rpx 0rpx 30rpx;
	}

	.query {
		background-color: #3298fe;
		padding: 20rpx 320rpx 20rpx 320rpx;
		position: fixed;
		bottom: 54rpx;
		border-radius: 69rpx 69rpx 69rpx 69rpx;
		font-size: 32rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;

	}

	input {
		text-align: right;
	}

	.grey {
		font-size: 24rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		font-weight: 500;
		color: #333333;
	}

	.center {
		padding: 30rpx 30rpx;
		margin-top: 30rpx 0rpx 0rpx 0rpx;
		background-color: #fff;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.center_a {
		margin-top: 30rpx;
		padding: 30rpx 30rpx;
		margin-top: 30rpx 0rpx 0rpx 0rpx;
		background-color: #fff;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.leixing {
		padding-right: 9rpx;
	}
</style>
